import React, { Component } from 'react'
import { Grid } from 'antd-mobile'
// import axios from 'axios'
import '../assets/styles/home/home-subjects.less'

export default class HomeSubject extends Component {
    constructor(props) {
        super(props)
        this.state = {
            data: [
                {
                    icon: require('../assets/images/subjectIcons1.png').default,
                    text: 'JAVA'
                },
                {
                    icon: require('../assets/images/subjectIcons2.png').default,
                    text: '随便'
                },
                {
                    icon: require('../assets/images/subjectIcons3.png').default,
                    text: '你好'
                },
                {
                    icon: require('../assets/images/subjectIcons3.png').default,
                    text: '你好'
                },
                {
                    icon: require('../assets/images/subjectIcons3.png').default,
                    text: '你好'
                },
                {
                    icon: require('../assets/images/subjectIcons3.png').default,
                    text: '你好'
                },
                {
                    icon: require('../assets/images/subjectIcons3.png').default,
                    text: '你好'
                }

            ]
        }
    }
    // componentDidMount() {
    //     // axios 去服务器请求数据回来
    //     axios.get('/data/subjects.json').then(res => {
    //         let { data } = res
    //         this.setState({ data })
    //     })
    // }
    render() {
        return (
            <div>
                <Grid data={this.state.data} hasLine={false} />
            </div>
        )
    }
}
